import httpRequest from '@/utils/hqqtRequest'

enum API {
    // 获取sku数据
    SKU_LIST = '/admin/product/list/',
    // 商品上架
    SALE_UP = '/admin/product/onSale/',
    // 商品下架
    SALE_DOWN = '/admin/product/cancelSale/',
    // 获取sku详情数据
    SKU_DATEILS = '/admin/product/getSkuInfo/',
    // 删除sku数据
    DELETE_SKU = '/admin/product/deleteSku/'
}

export const getSkuListAPI = (page: number, limit: number) => httpRequest({ url: API.SKU_LIST + `${page}/${limit}` })

export const upSaleApi = (sale: number) => httpRequest({ url: API.SALE_UP + sale })

export const downSaleApi = (sale: number) => httpRequest({ url: API.SALE_DOWN + sale })

export const getSkuIndoDetailsAPI = (skuId: number) => httpRequest({ url: API.SKU_DATEILS + skuId })

export const delSkuAPI = (skuId: number) => httpRequest({ url: API.DELETE_SKU + skuId, method: 'DELETE' })
